import QtQuick

Item {
    id: mechineParameterBack_ParameterWindow
    width: 1760
    height: 935

    property real fontSize: Cpp_Language.CurrentLanguage === 1 ? 40 : Cpp_Language.CurrentLanguage === 2 ? 25 : Cpp_Language.CurrentLanguage === 3 ? 25 : 40

    A_NumberKeyboard{
        id: mechineParameterKeyboard
        isDirectOverwrite: false
    }

    Component.onCompleted: {
        Cpp_PLC.read_Mechine_Parameters_Parameter_Setting_Hold();
    }

    Column{         // 左侧列表
        anchors.left: mechineParameterBack_ParameterWindow.left
        anchors.leftMargin: 100
        anchors.top: mechineParameterBack_ParameterWindow.top
        anchors.topMargin: 20

        spacing: 10

        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("原 点 值")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.OriginValue

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(210,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("手动速度")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.Manual_Location_Speed

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(1392,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("左锯工进时间")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.LeftSaws_OutTime

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(232,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("左锯45度补偿")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.LeftSaws_45_Compensate

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(670,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("料高检测时间")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.Material_Height_Observe_Time

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(1288,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("料高磁尺当量")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.Material_Height_Ruler_Scale

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(1290,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("测料高基准值")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.Material_Height_Observe_Base

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(680,value)
                }
            }

        }
        // Item{
        //     width: 700
        //     height: 80

        //     Rectangle{
        //         width: 300
        //         height: 80
        //         anchors.verticalCenter: parent.verticalCenter
        //         anchors.left: parent.left
        //         color: "transparent"
        //         // border.width: 1

        //         Text{
        //             anchors.centerIn: parent
        //             font.pixelSize: fontSize
        //             font.bold: true
        //             text: qsTr("左右吹气时间")
        //         }

        //     }

        //     A_NumberInput{      // 左右吹气时间输入框
        //         anchors.verticalCenter: parent.verticalCenter
        //         anchors.left: parent.left
        //         anchors.leftMargin: 310
        //         inputWidth: 300
        //         inputHeight: 80
        //         keyboard: mechineParameterKeyboard

        //         onEditingFinished: function(value){
        //             console.log(value)
        //         }
        //     }

        // }

    }



    Column{         // 右侧列表
        anchors.right: mechineParameterBack_ParameterWindow.right
        anchors.rightMargin: 100
        anchors.top: mechineParameterBack_ParameterWindow.top
        anchors.topMargin: 20

        spacing: 10


        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("压紧动作时间")
                }

            }

            A_NumberInput{      // 压料动作时间输入框
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.ImpactActiveTime

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(1280,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("定位速度")
                }

            }

            A_NumberInput{      // 定位速度输入框
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.Auto_Location_Speed

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(206,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("右锯工进时间")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.RightSaws_OutTime

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(234,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("右锯45度补偿")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.RightSaws_45_Compensate

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(672,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("左右吹气时间")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.Left_Right_Blow_Time

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_16_Hold(374,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("45度安全位置")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.Safe_Distance_45

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(1394,value)
                }
            }

        }
        Item{
            width: 700
            height: 80

            Rectangle{
                width: 300
                height: 80
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                color: "transparent"
                // border.width: 1

                Text{
                    anchors.centerIn: parent
                    font.pixelSize: fontSize
                    font.bold: true
                    text: qsTr("电磁阀断电延时")
                }

            }

            A_NumberInput{
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 310
                inputWidth: 300
                inputHeight: 80
                keyboard: mechineParameterKeyboard
                text: Cpp_PLC.Electric_Valve_Power_Off_Time

                onEditingFinished: function(value){
                    Cpp_PLC.write_into_PLC_32_Hold(238,value)
                }
            }

        }

    }




}
